﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Ceremony.API.Model
{
    public class Prize
    {
        public int Id { get; set; }
        /// <summary>
        /// 奖项名称
        /// </summary>
        public string PrizeName { get; set; }
        /// <summary>
        /// 标签
        /// </summary>
        public string Tag { get; set; }
        /// <summary>
        /// 图片名称
        /// </summary>
        public string ImageName{ get; set; }
        /// <summary>
        /// 层级（几等奖）
        /// </summary>
        public int Level { get; set; }
        /// <summary>
        /// 场次(1,2,3)
        /// </summary>
        public int Scene { get; set; }
        /// <summary>
        /// 数量
        /// </summary>
        public int Num { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }
        public void SubtractNum()
        {
            if (this.Num > 0)
                this.Num--;
        }
        private Prize (){ }

        public Prize(string prizeName,string tag,string imageName,int level,int sence,int nun)
        {
            this.PrizeName = prizeName;
            this.Tag = tag;
            this.ImageName = imageName;
            this.Level = level;
            this.Scene = sence;
            this.Num = nun;
            this.CreateTime = DateTime.Now;
        }
    }
}
